package pl.edu.agh.ros.proxy.node;

import org.ros.namespace.GraphName;
import org.ros.node.Node;
import org.ros.node.NodeConfiguration;
import org.ros.node.NodeFactory;

import pl.edu.agh.ros.proxy.internal.node.ProxyNode;

/**
 * @author snulio@gmail.com (Dariusz Zieba)
 */
public class ProxyNodeFactory implements NodeFactory {

	@Override
	public Node newNode(GraphName defaultNodeName, NodeConfiguration nodeConfiguration) {
		NodeConfiguration copy = NodeConfiguration.copyOf(nodeConfiguration);
		return new ProxyNode(copy.setDefaultNodeName(defaultNodeName));
	}

	@Override
	public Node newNode(String defaultNodeName, NodeConfiguration nodeConfiguration) {
		return newNode(new GraphName(defaultNodeName), nodeConfiguration);
	}

}
